Skip to content

Remove obsolete Literal deduplication assertion - #785

Merged
AlexWaygood merged 1 commit into
mainfrom
alex/fix-literal-unhashable-args-test
Aug 12, 2026
Merged

Remove obsolete Literal deduplication assertion#785
AlexWaygood merged 1 commit into
mainfrom
alex/fix-literal-unhashable-args-test

Conversation

@AlexWaygood

@AlexWaygood AlexWaygood commented Aug 12, 2026

Copy link
Copy Markdown
Member

Fixes #784.

Summary

Remove the assertion that Literal[[], []].__args__ is ([], []). python/cpython#153914 deliberately changed typing.Literal to deduplicate unhashable arguments, so Python 3.14.7 now returns ([],) instead. On supported Python versions where typing_extensions.Literal aliases typing.Literal, the old assertion therefore contradicts the standard library behavior.

This PR just deletes the assertion entirely: the behaviour here is now version-dependent, and the assertion was always testing an implementation detail that wasn't really that important.

Historical context

@codecov

codecov Bot commented Aug 12, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 97.26%. Comparing base (83400e9) to head (6e18c1c).

@@            Coverage Diff             @@
##             main     #785      +/-   ##
==========================================
- Coverage   97.26%   97.26%   -0.01%     
==========================================
  Files           3        3              
  Lines        7860     7859       -1     
==========================================
- Hits         7645     7644       -1     
  Misses        215      215              
Flag Coverage Δ
3.10 88.85% <ø> (-0.01%) ⬇️
3.10.4 88.85% <ø> (-0.01%) ⬇️
3.11 88.02% <ø> (-0.01%) ⬇️
3.11.0 87.27% <ø> (-0.01%) ⬇️
3.12 87.96% <ø> (-0.01%) ⬇️
3.12.0 87.94% <ø> (-0.01%) ⬇️
3.13 83.39% <ø> (-0.01%) ⬇️
3.13.0 84.09% <ø> (-0.01%) ⬇️
3.14 79.53% <ø> (-0.01%) ⬇️
3.9 89.53% <ø> (-0.01%) ⬇️
3.9.12 89.53% <ø> (-0.01%) ⬇️
pypy3.10 88.68% <ø> (-0.01%) ⬇️
pypy3.11 87.88% <ø> (-0.01%) ⬇️
pypy3.9 89.37% <ø> (-0.01%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

Files with missing lines Coverage Δ
src/test_typing_extensions.py 98.23% <ø> (-0.01%) ⬇️
🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@AlexWaygood
AlexWaygood marked this pull request as ready for review August 12, 2026 11:56

@srittau srittau left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Makes sense to me.

@AlexWaygood
AlexWaygood merged commit 79c903c into main Aug 12, 2026
25 checks passed
@AlexWaygood
AlexWaygood deleted the alex/fix-literal-unhashable-args-test branch August 12, 2026 12:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

test_typing_extensions.LiteralTests.test_args is failing with python 3.14.7

2 participants